import request from '@/utils/request'

// 查询组织信息列表
export function listOrg(query) {
  return request({
    url: '/committee/org/list',
    method: 'get',
    params: query
  })
}

// 查询组织信息详细
export function getOrg(orgId) {
  return request({
    url: '/committee/org/' + orgId,
    method: 'get'
  })
}

// 新增组织信息
export function addOrg(data) {
  return request({
    url: '/committee/org',
    method: 'post',
    data: data
  })
}
// 新增研究生班团
export function addGraduate(data) {
  return request({
    url: '/committee/org/addGraduate',
    method: 'post',
    timeout: 30000,
    data: data
  })
}
// 批量新增研究生
export function batchAddGraduate(data) {
  return request({
    url: '/committee/org/batchAddGraduate',
    method: 'post',
    timeout: 30000,
    data: data
  })
}
// 批量新增本科生
export function batchAddUnderGraduate(data) {
  return request({
    url: '/committee/org/batchAddUnderGraduate',
    method: 'post',
    timeout: 30000,
    data: data
  })
}
// 同步所有研究生班团
export function addGraduateAll() {
  return request({
    url: '/committee/org/addGraduateAll',
    method: 'post',
    timeout: 300000,
  })
}

// 修改组织信息
export function updateOrg(data) {
  return request({
    url: '/committee/org',
    method: 'put',
    data: data
  })
}

// 删除组织信息
export function delOrg(orgId) {
  return request({
    url: '/committee/org/' + orgId,
    method: 'delete'
  })
}

// 学生管理员下拉框
export function getstudentmanager(parm) {
  return request({
    url: '/committee/org/getstudentmanager/' + parm,
    method: 'get'
  })
}
// 教师管理员下拉框
export function getTeacherManager(parm) {
  return request({
    url: '/committee/org/getTeacherManager/' + parm,
    method: 'get'
  })
}
// 设置学生管理员
export function setstudentmanager(data) {
  return request({
    url: '/committee/org/setstudentmanager',
    method: 'put',
    data: data
  })
}
// 设置教师管理员
export function setteachermanager(data) {
  return request({
    url: '/committee/org/setteachermanager',
    method: 'put',
    data: data
  })
}
// 设置当前学期
export function editDefaultSchoolYear(data) {
  return request({
    url: '/committee/year/editDefaultSchoolYear',
    method: 'put',
    data: data
  })
}